import tkinter as tk
from tkinter import ttk
def update_progress():
    total = 10000
    progress_bar['maximum'] = total
    for i in range(total):
        for j in range(total):
            k = i * j
        progress_bar['value'] = i
        root.update_idletasks()
root = tk.Tk()
root.title("进度条示例")
# 创建进度条
progress_bar = ttk.Progressbar(root,
                               orient='horizontal', length=300, mode='determinate')
progress_bar.pack(pady=20)
# 开始更新进度条
update_progress()
root.mainloop()